<?php


namespace app\controller\Web;

use hg\apidoc\annotation as Apidoc;
use app\service\Web\ApiDocTestService;

/**
 * @Apidoc\Title("ApiDoc测试")
 * Class ApiDocTestController
 * @package app\controller\Web
 */
class ApiDocTestController
{
    /**
     * @Apidoc\Title("引入逻辑层注释")
     * @Apidoc\Method("POST")
     * @Apidoc\Desc("以下Param注解中，三种ref方式等价")
     * @Apidoc\Param(ref="app\service\Web\ApiDocTestService\getUserInfo")
     * @Apidoc\Param(ref="app\service\Web\ApiDocTestService@getUserInfo")
     * @Apidoc\Param(ref={ApiDocTestService::class,"getUserInfo"})
     * @Apidoc\Returned(ref={ApiDocTestService::class,"getUserInfo"})
     */
    public function service(){
        //...
    }

    /**
     * @Apidoc\Title("测试1")
     * @Apidoc\Returned("list",type="array", require=false, default="[]",desc="列表",table="api_doc_test")
     */
    public function test1(){

    }

    /**
     * @Apidoc\Title("测试2")
     * @Apidoc\Method("POST")
     * @Apidoc\Returned(ref="app\model\ApiDocTest@listReturn",desc="指定引入模型的方法,会通过listReturn的注解处理数据表字段")
     * //@Apidoc\Returned(ref={app\model\ApiDocTest::class,"listReturn"},desc: "指定引入模型的方法,会通过listReturn的注解处理数据表字段"【测试未通过】" )
     * //@Apidoc\Returned(ref="app\model\ApiDocTest",desc="直接引入该模型数据表字段")
     * //@Apidoc\Returned(ref={app\model\ApiDocTest::class},desc: "直接引入该模型数据表字段【测试未通过】" )
     */
    public function test2(){

    }

}